package com.zb.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.zb.entity.ZjWorkFeeDetail;
import com.zb.extend.WorkFeeDetailExtend;
import com.zb.vo.ExpenseRecordVo;
import com.zb.vo.WorkTotalFeeVo;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * <p>
 * 工单费用信息表 Mapper 接口
 * </p>
 *
 * @author WEN
 * @since 2023-10-25
 */
@Repository
public interface ZjWorkFeeDetailMapper extends BaseMapper<ZjWorkFeeDetail> {

    /**
     * 根据工单ID获取工单服务费用（注：根据工单费用ID分组查询）
     * @param workIds 工单ID
     * @return
     */
    List<WorkFeeDetailExtend> getGroupByWorkIds(@Param("workIds") List<Long> workIds);

    /**
     * 根据工单ID获取工单服务费结算价
     * @param workIds 工单ID
     * @return
     */
    List<ZjWorkFeeDetail> getOrderSettlementFeeByWorkId(@Param("workIds") List<Long> workIds);

    /**
     * 根据工单ID获取异常费用，即服务商申请的费用
     * @param workIds 工单ID
     * @return
     */
    List<ZjWorkFeeDetail> getExceptionFeeByWorkIds(@Param("workIds") List<Long> workIds);

    /**
     * 根据工单ID获取费用信息
     * @param workId 工单ID
     * @return
     */
    List<WorkFeeDetailExtend> getByWorkId(@Param("workId") Long workId);

    /**
     * 根据工单ID获取费用信息
     * @param workId
     * @return
     */
    List<ExpenseRecordVo> getByWorkOrderId(@Param("workId") Long workId);

    /**
     * 根据工单ID & 工单费用项目ID查询
     * @param workId 工单ID
     * @param workFeeProjectId 工单费用项目ID
     * @return
     */
    ZjWorkFeeDetail getByWorkIdAndWorkFeeProjectId(@Param("workId") Long workId, @Param("workFeeProjectId") Long workFeeProjectId);

}
